﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shop.Data;

namespace Shop.CartResources
{
    class QuantityItem : ICartItem
    {
        public string Barcode {get; set; }
        public string Specification { get; set; }
        public decimal Price { get; set; }
        public int QuantityBought { get; set; }

        public QuantityItem(ShopItem innerItem, int quantityToBuy)
        {
            this.Barcode = innerItem.Barcode;
            this.Specification = innerItem.Specification;
            this.Price = innerItem.Price * quantityToBuy;
            this.QuantityBought = quantityToBuy;
        }

        public override bool Equals(object obj)
        {
            return base.Equals(obj);
        }

        public override string ToString()
        {
            return string.Format("Barcode: {0}, Specification: {1}, Price: {2}", Barcode, Specification, Price);
        }
    }
}
